<?php
class product_management {	
	
	function getProductById($productId) {
		$sql="SELECT * FROM tbl_product WHERE product_id='$productId'";
		$rst=mysql_query($sql);
		if($rst) { $row=mysql_fetch_array($rst); return $row; }
		else { return false; }
	}
	
	function getAllProduct() {
		$sql="SELECT * FROM tbl_product ORDER BY product_id DESC";
		$rst=mysql_query($sql);
		if($rst) { 
			$num=mysql_num_rows($rst);
			if($num > 0) {
				while($row=mysql_fetch_array($rst)) { 
					$data[]=$row; 
				} return $row; 
			}
		}
		else { return false; }
	}
	
	
}	 
?>